/**
 * @file bsp_i2c.h
 * @brief I2C driver for H743-V2 Flight Control System
 */

#ifndef __BSP_I2C_H
#define __BSP_I2C_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

typedef enum {
    I2C_PORT_1 = 0,  // External (Magnetometer)
    I2C_PORT_2,      // Internal (Barometer, Power Monitor)
    I2C_PORT_COUNT
} I2CPort_t;

int BSP_I2C_Init(void);
int BSP_I2C_Write(I2CPort_t port, uint8_t addr, const uint8_t *data, uint16_t len);
int BSP_I2C_Read(I2CPort_t port, uint8_t addr, uint8_t *data, uint16_t len);

#ifdef __cplusplus
}
#endif

#endif /* __BSP_I2C_H */

